package com.heima.user.controller;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.model.user.dtos.LoginDto;
import com.heima.user.service.ApUserLoginService;
import com.heima.user.service.ApUserRealnameService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "用户实名认证",tags = "用户实名认证的API")
@RestController
@RequestMapping("/api/v1/auth")
public class ApUserRealnameController  {
    @Autowired
    ApUserRealnameService apUserRealnameService;

    @Autowired
    ApUserLoginService apUserLoginService;

    @PostMapping("/list")
    @ApiOperation(value = "根据状态查询实名认证列表")
    public ResponseResult loadListByStatus(@RequestBody AuthDto dto) {
        return apUserRealnameService.loadListByStatus(dto);
    }


    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserRealnameService.authPass(dto);
    }

    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserRealnameService.authFail(dto);
    }

}
